/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Acer
 */
@Entity
@Table(name = "tb_Category", catalog = "East2West_TourAndTravel", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "TbCategory.findAll", query = "SELECT t FROM TbCategory t"),
    @NamedQuery(name = "TbCategory.findByCatID", query = "SELECT t FROM TbCategory t WHERE t.catID = :catID"),
    @NamedQuery(name = "TbCategory.findByCatName", query = "SELECT t FROM TbCategory t WHERE t.catName = :catName"),
    @NamedQuery(name = "TbCategory.findByDeleteSTT", query = "SELECT t FROM TbCategory t WHERE t.deleteSTT = :deleteSTT")})
public class TbCategory implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "cat_ID", nullable = false)
    private Integer catID;
    @Column(name = "cat_Name", length = 50)
    private String catName;
    @Column(name = "deleteSTT")
    private Integer deleteSTT;
    @OneToMany(mappedBy = "catID")
    private List<TbTours> tbToursList;

    public TbCategory() {
    }

    public TbCategory(Integer catID) {
        this.catID = catID;
    }

    public Integer getCatID() {
        return catID;
    }

    public void setCatID(Integer catID) {
        this.catID = catID;
    }

    public String getCatName() {
        return catName;
    }

    public void setCatName(String catName) {
        this.catName = catName;
    }

    public Integer getDeleteSTT() {
        return deleteSTT;
    }

    public void setDeleteSTT(Integer deleteSTT) {
        this.deleteSTT = deleteSTT;
    }

    public List<TbTours> getTbToursList() {
        return tbToursList;
    }

    public void setTbToursList(List<TbTours> tbToursList) {
        this.tbToursList = tbToursList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (catID != null ? catID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbCategory)) {
            return false;
        }
        TbCategory other = (TbCategory) object;
        if ((this.catID == null && other.catID != null) || (this.catID != null && !this.catID.equals(other.catID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.TbCategory[catID=" + catID + "]";
    }

}
